package com.qiaofang.applet.service.property.service.dto;

import com.qiaofang.applet.common.base.BaseDto;
import com.qiaofang.applet.service.property.domain.EstateStory;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * Created by IDEA.
 *
 * @auther Zym.
 * @company qiaofang
 * @date 2020/10/13 13:59
 */
@Data
@ApiModel("小区详情展示DTO")
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class EstateShowDto extends BaseDto {

    @ApiModelProperty("楼盘唯一UUID")
    private String estateUniqueUuid;

    @ApiModelProperty("楼盘名称")
    private String estateName;

    @ApiModelProperty("区县唯一标识")
    private String districtUuid;

    @ApiModelProperty("区县名称")
    private String districtName;

    @ApiModelProperty("商圈唯一标识")
    private String areaUuid;

    @ApiModelProperty("商圈名称")
    private String areaName;

    @ApiModelProperty("小区展示图")
    private String photoUrl;

    @ApiModelProperty("总户数")
    private Integer totalRoomCount;

    @ApiModelProperty("土地地号")
    private String landNo;

    @ApiModelProperty("物业主")
    private String estateOwner;

    @ApiModelProperty("物业主电话")
    private String estateOwnerTel;

    @ApiModelProperty("所属项目")
    private String belongProject;

    @ApiModelProperty("投放年代")
    private String completeYear;

    @ApiModelProperty("产权年数")
    private Integer ownYear;

    @ApiModelProperty("产权描述")
    private String ownedType;

    @ApiModelProperty("概要地址")
    private String shortAddress;

    @ApiModelProperty("详细地址")
    private String fullAddress;

    @ApiModelProperty("物业公司")
    private String managementCompany;

    @ApiModelProperty("物业公司电话")
    private String managementCompanytel;

    @ApiModelProperty("管理费")
    private String managementFee;

    @ApiModelProperty("经度")
    private Double lng;

    @ApiModelProperty("纬度")
    private Double lat;

    @ApiModelProperty("建筑类型")
    private String propertyUsage;

    @ApiModelProperty("小区类型")
    private String propertyType;

    @ApiModelProperty("结构")
    private String framework;

    @ApiModelProperty("建筑外墙")
    private String surface;

    @ApiModelProperty("别名")
    private String alias;

    @ApiModelProperty("开发商")
    private String developer;

    @ApiModelProperty("备注")
    private String remark;

    @ApiModelProperty("均价")
    private BigDecimal sellPrice;

    @ApiModelProperty("本月参考售均价")
    private BigDecimal currentSellPrice;

    @ApiModelProperty("本月参考租均价")
    private BigDecimal currentRentPrice;

    @ApiModelProperty("在售套数")
    private Integer saleNum;

    @ApiModelProperty("在租套数")
    private Integer rentNum;

    @ApiModelProperty("小区介绍")
    private String introduction;

    @ApiModelProperty("小区行车路线")
    private String driveCircuit;

    @ApiModelProperty("周边配套说明")
    private String surroundingExplain;

    @ApiModelProperty("户型情况")
    private String houseTypeDes;

    @ApiModelProperty("居住情况")
    private String dwellDes;

    @ApiModelProperty("居住人群")
    private String dwellCrowd;

    @ApiModelProperty("外景图集")
    private List<String> outerPhotoList;

    @ApiModelProperty("小区相册图片数")
    private Integer albumPhotoNum;

    @ApiModelProperty("小区相册展示图")
    private String albumPhotoShow;

//    @ApiModelProperty("小区相册")
//    Map<String, List<EstateAlbumPhotoDto>> albumPhotoMap;

    @ApiModelProperty("户型对应房源")
    private Map<String, List<HouseTypeDto>> typeFyMap;

    @ApiModelProperty("小区故事")
    private List<EstateStory> storyList;

    @ApiModelProperty("周边小区推荐")
    private List<EstateListDto> surroundingEstates;

    @ApiModelProperty("小区信息全部展开")
    private Boolean unfold;

    @ApiModelProperty("小区相册")
    private List<EstateDetailsPhotoDto> estateDetailsPhotoDtos;

    public Integer getOwnYear(){
        if (StringUtils.isNotBlank(completeYear)){
            return Integer.valueOf(completeYear);
        }
        return ownYear;
    }
}
